package middleware

import (
	"github.com/gin-gonic/gin"
	"oa-rest/common"
)

func RequestId() gin.HandlerFunc {
	return func(c *gin.Context) {
		id := common.NewUUID()
		c.Set("request_id", id)
		c.Writer.Header().Set("X-Request-Id", id)
		c.Next()
	}
}
